= render_ce "projects/merge_requests/show"

- if ::Llm::MergeRequests::SummarizeDiffService.enabled?(group: @merge_request.project.root_ancestor, user: current_user)
  #js-summary-notes{ data: { project_path: @project.full_path, iid: @merge_request.iid, empty_state_svg: image_path('illustrations/empty-state/empty-activity-md.svg') } }

= javascript_tag do
  :plain
    // Append static, server-generated data not included in merge request entity (EE-Only)
    // Object.assign would be useful here, but it blows up Phantom.js in tests
    window.gl.mrWidgetData.is_geo_secondary_node = '#{Gitlab::Geo.secondary?}' === 'true';
    window.gl.mrWidgetData.geo_secondary_help_path = '#{help_page_path("administration/geo/replication/configuration.md")}';
    window.gl.mrWidgetData.sast_help_path = '#{help_page_path("user/application_security/sast/index")}';
    window.gl.mrWidgetData.secret_detection_help_path = '#{help_page_path("user/application_security/secret_detection/index")}';
    window.gl.mrWidgetData.container_scanning_help_path = '#{help_page_path("user/application_security/container_scanning/index")}';
    window.gl.mrWidgetData.dast_help_path = '#{help_page_path("user/application_security/dast/index")}';
    window.gl.mrWidgetData.dependency_scanning_help_path = '#{help_page_path("user/application_security/dependency_scanning/index")}';
    window.gl.mrWidgetData.api_fuzzing_help_path = '#{help_page_path("user/application_security/api_fuzzing/index")}';
    window.gl.mrWidgetData.coverage_fuzzing_help_path = '#{help_page_path("user/application_security/coverage_fuzzing/index")}';
    window.gl.mrWidgetData.visual_review_app_available = '#{@project.feature_available?(:visual_review_app)}' === 'true';
    window.gl.mrWidgetData.license_scanning_comparison_path = '#{license_scanning_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:license_scanning)}'
    window.gl.mrWidgetData.license_scanning_comparison_collapsed_path = '#{license_scanning_reports_collapsed_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:license_scanning)}'
    window.gl.mrWidgetData.container_scanning_comparison_path = '#{container_scanning_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:container_scanning)}'
    window.gl.mrWidgetData.dependency_scanning_comparison_path = '#{dependency_scanning_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:dependency_scanning)}'
    window.gl.mrWidgetData.sast_comparison_path = '#{sast_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:sast)}'
    window.gl.mrWidgetData.dast_comparison_path = '#{dast_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:dast)}'
    window.gl.mrWidgetData.secret_detection_comparison_path = '#{secret_detection_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:secret_detection)}'
    window.gl.mrWidgetData.coverage_fuzzing_comparison_path = '#{coverage_fuzzing_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:coverage_fuzzing)}'
    window.gl.mrWidgetData.api_fuzzing_comparison_path = '#{api_fuzzing_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:api_fuzzing)}'
    window.gl.mrWidgetData.new_container_scanning_comparison_path = '#{security_reports_project_merge_request_path(@project, @merge_request, type: :container_scanning) if @project.feature_available?(:container_scanning)}'
    window.gl.mrWidgetData.new_dependency_scanning_comparison_path = '#{security_reports_project_merge_request_path(@project, @merge_request, type: :dependency_scanning) if @project.feature_available?(:dependency_scanning)}'
    window.gl.mrWidgetData.new_sast_comparison_path = '#{security_reports_project_merge_request_path(@project, @merge_request, type: :sast) if @project.feature_available?(:sast)}'
    window.gl.mrWidgetData.new_dast_comparison_path = '#{security_reports_project_merge_request_path(@project, @merge_request, type: :dast) if @project.feature_available?(:dast)}'
    window.gl.mrWidgetData.new_secret_detection_comparison_path = '#{security_reports_project_merge_request_path(@project, @merge_request, type: :secret_detection) if @project.feature_available?(:secret_detection)}'
    window.gl.mrWidgetData.new_coverage_fuzzing_comparison_path = '#{security_reports_project_merge_request_path(@project, @merge_request, type: :coverage_fuzzing) if @project.feature_available?(:coverage_fuzzing)}'
    window.gl.mrWidgetData.new_api_fuzzing_comparison_path = '#{security_reports_project_merge_request_path(@project, @merge_request, type: :api_fuzzing) if @project.feature_available?(:api_fuzzing)}'
    window.gl.mrWidgetData.aiCommitMessageEnabled = #{::Llm::GenerateCommitMessageService.new(current_user, @merge_request).valid?.to_s}
